home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Compute`s Amiga resource 1.adf / Source / 8ColorWbench / Normalbench.c < prev    next >
C/C++ Source or Header  |  1989-02-08  |  986b  |  47 lines

  1. /*************************************************************************
  2.  *
  3.  *        Normalbench.c
  4.  *
  5.  *        Return the Workbench screen to normal. (Reverses the effect of
  6.  *    Colorbench.)
  7.  *
  8.  *************************************************************************/
  9.  
  10. #include <intuition/intuition.h>
  11.  
  12. struct Screen *Scr;
  13. struct BitMap *bm;
  14. struct IntuitionBase *IntuitionBase;
  15. struct GfxBase *GfxBase;
  16.  
  17. #define    WIDTH        Scr->Width
  18. #define    HEIGHT    Scr->Height
  19. #define    DEPTH        bm->Depth
  20.  
  21. void main()
  22. {
  23.     if((IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 32)) == NULL)
  24.         exit(100);
  25.  
  26.     if((GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 32)) == NULL)
  27.       exit(200);
  28.  
  29.     Scr = (struct Screen *)OpenWorkBench();
  30.    if(Scr == NULL)
  31.        exit(300);
  32.  
  33.     bm = Scr->RastPort.BitMap;
  34.  
  35.     if(DEPTH == 3)
  36.     {
  37.         FreeRaster(bm->Planes[2], WIDTH, HEIGHT);
  38.         DEPTH = 2;
  39.         RemakeDisplay();
  40.     }
  41.  
  42.     CloseLibrary(GfxBase);
  43.     CloseLibrary(IntuitionBase);
  44. }
  45.  
  46. /*   end of Normalbench.c   */
  47.